package com.yaozheng.vocationaltraining.view.paper;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.yaozheng.vocationaltraining.R;
import com.yaozheng.vocationaltraining.dialog.interfaces.BaseDialogEventProcess;

import org.androidannotations.annotations.Click;
import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;

/**
 * 交卷提示
 */
@EViewGroup(R.layout.view_dialog_carry_out_an_assignment_ask)
public class CarryOutAnAssignmentAskView extends LinearLayout {
    @ViewById
    TextView baseDialogContentTextView, baseDialogOperateExplanationId;

    BaseDialogEventProcess baseDialogEventProcess;

    public CarryOutAnAssignmentAskView(Context context) {
        super(context);
    }

    public CarryOutAnAssignmentAskView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public void setBaseDialogEventProcess(BaseDialogEventProcess baseDialogEventProcess) {
        this.baseDialogEventProcess = baseDialogEventProcess;
    }

    /**
     * 设置内容
     *
     * @param contentValue
     */
    public void setContentValue(String contentValue) {
        baseDialogContentTextView.setText(contentValue);
    }

    /**
     * 设置标题
     *
     * @param titleValue
     */
    public void setTitleValue(String titleValue) {
        baseDialogOperateExplanationId.setText(titleValue);
    }

    /**
     * 确定点击
     */
    @Click(R.id.baseDialogDetermineView)
    public void determineClick() {
        if (baseDialogEventProcess != null) {
            baseDialogEventProcess.runMethod("determine");
        }
    }

    /**
     * 试卷详情
     */
    @Click(R.id.baseDialogDetailsView)
    public void detailsClick(){
        if (baseDialogEventProcess != null) {
            baseDialogEventProcess.runMethod("details");
        }
    }

}
